/*
 * @Author: zhangshu
 * @email: shiliang.zhang@tuya.com
 * @LastEditors: Please set LastEditors
 * @file name: app_led.h
 * @Description: 
 * @Copyright: HANGZHOU TUYA INFORMATION TECHNOLOGY CO.,LTD
 * @Company: http://www.tuya.com
 * @Date: 2022-02-08
 * @LastEditTime: 2022-02-08
 */
#ifndef __APP_EXT_KEY_H__
#define __APP_EXT_KEY_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "app_common.h"
#include "tal_mf_test.h"
#include "tuya_hal_gpio.h"
#include "bsp.h"

typedef UINT8_T EXT_KEY_STATUS_E;
#ifndef EXT_KEY_OFF
#define EXT_KEY_OFF 0
#endif
#ifndef EXT_KEY_ON
#define EXT_KEY_ON 1
#endif

// key push short times
#define KEY_PUSH_TIME_SHORT   700
#define EXT_KEY_1_IO_INDEX    0
#define EXT_KEY_2_IO_INDEX    0
#define EXT_KEY_3_IO_INDEX    0
#define LONE_PRESS_TIME       800
#define LONG_PRESS_TIME_CONST 80
#define LONG_PRESS_END        0



OPERATE_RET app_ext_key_oem_init(key_config_t *config);
// VOID_T user_active_get(TUYA_GPIO_NUM_E *key_pins);
UINT8_T gpio_ext_key_read_keys(TUYA_GPIO_NUM_E *keys);
VOID_T gpio_ext_key_interrupt_handler(UINT32_T ext_key_id, KEY_ST_T key_st, UINT32_T push_time);
// VOID_T key_press_callback(UINT32_T time_ms,UINT8_T index, TUYA_GPIO_NUM_E key_pins);


#ifdef __cplusplus
}
#endif

#endif
